home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / gtlayout-source.lha / LTP_SizeDimensions.c < prev    next >
C/C++ Source or Header  |  1995-09-24  |  2KB  |  85 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. STATIC VOID __regargs
  10. LTP_GetSizeDimensions(LayoutHandle *Handle,ULONG *SizeWidth,ULONG *SizeHeight)
  11. {
  12.     Object    *SizeImage;
  13.     UWORD     SizeType;
  14.  
  15.     if(Handle -> Screen -> Flags & SCREENHIRES)
  16.     {
  17.         if(SizeWidth)
  18.             *SizeWidth = 18;
  19.  
  20.         if(SizeHeight)
  21.             *SizeHeight = 10;
  22.  
  23.         SizeType = SYSISIZE_MEDRES;
  24.     }
  25.     else
  26.     {
  27.         if(SizeWidth)
  28.             *SizeWidth = 13;
  29.  
  30.         if(SizeHeight)
  31.             *SizeHeight = 11;
  32.  
  33.         SizeType = SYSISIZE_LOWRES;
  34.     }
  35.  
  36.     if(SizeImage = NewObject(NULL,SYSICLASS,
  37.         SYSIA_Size,        SizeType,
  38.         SYSIA_Which,    SIZEIMAGE,
  39.         SYSIA_DrawInfo,    Handle -> DrawInfo,
  40.     TAG_DONE))
  41.     {
  42.         if(SizeWidth)
  43.             GetAttr(IA_Width,SizeImage,SizeWidth);
  44.  
  45.         if(SizeHeight)
  46.             GetAttr(IA_Height,SizeImage,SizeHeight);
  47.  
  48.         DisposeObject(SizeImage);
  49.     }
  50. }
  51.  
  52.  
  53. /*****************************************************************************/
  54.  
  55.  
  56. ULONG __regargs
  57. LTP_GetSizeWidth(struct LayoutHandle *handle)
  58. {
  59.     ULONG SizeWidth;
  60.  
  61.     LTP_GetSizeDimensions(handle,&SizeWidth,NULL);
  62.  
  63.     if(SizeWidth < handle -> Screen -> WBorRight)
  64.         return(handle -> Screen -> WBorRight);
  65.     else
  66.         return(SizeWidth);
  67. }
  68.  
  69.  
  70. /*****************************************************************************/
  71.  
  72.  
  73. ULONG __regargs
  74. LTP_GetSizeHeight(struct LayoutHandle *handle)
  75. {
  76.     ULONG SizeHeight;
  77.  
  78.     LTP_GetSizeDimensions(handle,NULL,&SizeHeight);
  79.  
  80.     if(SizeHeight < handle -> Screen -> WBorBottom)
  81.         return(handle -> Screen -> WBorBottom);
  82.     else
  83.         return(SizeHeight);
  84. }
  85.